package com.example.shareapp;

import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.Environment;
import android.os.StrictMode;
import android.support.multidex.MultiDex;

import com.example.shareapp.utils.Logger;
import com.mob.MobSDK;


/**
 * Created by cx on 2017/12/12.
 */

public class MyApplication extends Application {
    public static String openID="";
    public static String DeviceID="";
    public static String KEFU_PHONE="";
    public static boolean USEVIP = false;
    private static Context context;
    private static Application application;

            public static final String APP_ID = "9b157bc9f2"; // TODO 替换成bugly上注册的appid
    public static final String APP_CHANNEL = "DEBUG"; // TODO 自定义渠道
    private static final String TAG = "OnUILifecycleListener";
    public static String defaultUrl = Environment.getExternalStorageDirectory() + "";

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }

    @Override
    public void onCreate() {
        super.onCreate();
        context = this;
        application = this;
        MobSDK.init(context);
        MobSDK.submitPolicyGrantResult(true, null);
        if(Build.VERSION.SDK_INT >= 24) {
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.setVmPolicy(builder.build());
        }
        Logger.getInstance().init(getPackageName());
//        MapUtils.setMapCustomFile(this, "custommapconfig.json");
//        SDKInitializer.initialize(this);
//        InitIntentService.start(this);
    }

    public static Context getContext(){
        return context;
    }
    public static Application getApplication(){
        return application;
    }


}
